import React from 'react';
export default class PostUser extends React.Component {
  constructor(props) {
    super(props);
  }

  getParams(name,deflt) {
  	if(!deflt) {
  		deflt = null;
  	}
  	return this.props.userinfo!=null?this.props.userinfo[name]:deflt;
  }

  render() {
    return (
      <div className="author_info">
      	<div className="author_info_header">
          <div className="hover info_title hightitle"><span className="title-line"></span>作者</div>
      		<div className="img_header">
      			{this.props.userinfo!=null?(<img src={this.props.userinfo.headpic} className="author_head"/>):(<div className='load-pic'>loading...</div>)}
      		</div>
      		<div className="author_name">
      			<span>{this.getParams('nickName','正在加载...')}&nbsp;&nbsp;<a href="#" style={{color:'red',fontWeight:'100'}}>加关注</a></span>
      		</div>
      		<div className="author_descpriton">
      			<span>{this.getParams('description','他没有什么可说的')}</span>
      		</div>
      	</div>
        <div className="author_connect_info">
          <table>
            <tbody>
              <tr>
                <td>原创</td>
                <td>粉丝</td>
                <td>关注</td>
                <td>喜欢</td>
              </tr>
              <tr>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
              </tr>
            </tbody>
          </table>
        </div>
      </div>
    );
  }
}